﻿using UnityEngine;

public class Root : MonoBehaviour
{
    // Use this for initialization
    void Awake()
    {
        //后台运行
        Application.runInBackground = true;
        //限制帧率30
        Application.targetFrameRate = 30;
        Screen.sleepTimeout = SleepTimeout.NeverSleep;

        Log.Init(true, false, Application.persistentDataPath);

        PathMgr pathMgr = gameObject.AddComponent<PathMgr>();
        pathMgr.Init();

        ResMgr resMgr = gameObject.AddComponent<ResMgr>();
        resMgr.Init(StartUp);
    }

    void StartUp()
    {
        gameObject.AddComponent<MsgMgr>();
        gameObject.AddComponent<NetMgr>();
        gameObject.AddComponent<UIMgr>();
        //跳转场景不销毁
        DontDestroyOnLoad(gameObject);
        UIMgr.Instance.Show<UpdateView>();
    }
}